<template>
     <div class="input">
        <el-input v-model="input" :placeholder=" placeholder" @blur="getVal" />
     </div>
</template>

<script setup lang="ts">
import { ref ,watch} from 'vue'
 let props:any =  defineProps({
    placeholder:{
        type:String,
        default:'请输入'
    },
    clears:{
        type:Boolean,
        default:false
    }
})
  //  监听用户操作
watch(()=>props.clears,(newVal)=>{
    input.value = ''
})

 let emits = defineEmits(['getInputV'])
const getVal = ()=>{
     console.log(input,666663); //获取到用户的数据=》发送给父亲
      emits('getInputV',input.value)
}
const input = ref('')
</script>

<style scoped lang="scss"> 
   .input{
    margin-left:10px;
   }
</style>